package com.example.rabbitmqspringboot.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zfj
 * @date 2022/4/26 -20:07
 */
@Slf4j
@Component
public class WarningConsumer {
	public static final String WARNING_QUEUE_NAME = "warning.queue";
	@RabbitListener(queues = WARNING_QUEUE_NAME)
	public void receiveWarningMsg(Message message) {
		String msg = new String(message.getBody());
		log.error("报警发现不可路由消息：{}", msg);
	}

}
